<template>
  <div class="father">
    <h3>父组件</h3>
    <div class="content">
      <Category title="hot game list">
        <ul>
          <li v-for="g in games" :key="g.id">{{ g.name }}</li>
        </ul>
      </Category>
      <Category title="today food city">
        <img :src="imgUrl" alt="">
      </Category>
      <Category title="today movie tj">
        <video :src="videoUrl" controls></video>
      </Category>
    </div>
  </div>
</template>

<script setup lang="ts" name="Father">
  import Category from './Category.vue';
  import { ref, reactive } from 'vue';

  let games = reactive([
    {id: 'aaa01', name: 'LoL'},
    {id: 'aaa02', name: 'PoP'},
    {id: 'aaa03', name: 'YiY'},
    {id: 'aaa04', name: 'Apa'},
  ])
  let imgUrl = ref('http://m.cqpwx168.com/d/file/xiangmu/chongqing/388d4fd669d725f610a26429fe5bfc15.jpg')
  let videoUrl = ref('https://media.w3.org/2010/05/sintel/trailer.mp4')
</script>

<style scoped>
  .father {
    background-color: rgb(165, 164, 164);
    padding: 20px;
    border-radius: 10px;
  }
  .content {
    display: flex;
    justify-content: space-evenly;
  }
  img,video {
    width: 100%;
  }
</style>